import React , {memo,useEffect} from 'react'
// import { connect } from "react-redux";
import { useDispatch,useSelector,shallowEqual } from "react-redux";
// import actions from "store/action/index.js";
import recommend from "store/action/recommend.js";

function WYAlbum(props) {
    const dispatch = useDispatch();
    // const state =useSelector(state=>({...state.recommend}),shallowEqual)
    // const topBanners =useSelector(state=>(state.get('recommend').get('topBanners')),shallowEqual)
    //getIn是 .get的语法糖 
    const topBanners =useSelector(state=>(state.getIn(['recommend','topBanners'])),shallowEqual)
    console.log(topBanners)
 
    useEffect(() => {
        dispatch(recommend.getTopBanner())
    }, [dispatch])

    return (
    <div>
        
    </div>
    )
}
export default memo(WYAlbum)

// export default connect(state=>({...state.recommend}),actions.recommend)(memo(WYAlbum))

